﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;
using BaseTypesLib.Model.Fonts;
using ExplorerInfrastructure;

namespace BaseTypesLib.Converters
{
    public class FontSizeConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            Font font = (Font)value;
            if (font == null)
            {
                ProjectInfo pi = ProjectInfo.GetInstance();
                return pi.FontSize == 0 ? 27 : pi.FontSize;
            }
            else
                return font.Height;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
